<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        // <
        var a = 1;
        var b = 2;
        var r = a < b;
        console.log('a = ' + a + ', b = ' + b + ', a < b = ' + r);

        // >
        var a = 1;
        var b = 2;
        var r = a > b;
        console.log('a = ' + a + ', b = ' + b + ', a > b = ' + r);

        // <=
        var a = 1;
        var b = 2;
        var r = a <= b;
        console.log('a = ' + a + ', b = ' + b + ', a <= b = ' + r);

        // >=
        var a = 1;
        var b = 2;
        var r = a >= b;
        console.log('a = ' + a + ', b = ' + b + ', a >= b = ' + r);

        // ==
        var a = 1;
        var b = 2;
        var r = a == b;
        console.log('a = ' + a + ', b = ' + b + ', a == b = ' + r);
        var a = 'string';
        var b = "string";
        var r = a == b;
        console.log('a = ' + a + ', b = ' + b + ', a == b = ' + r);
        var a = 123;
        var b = '123';
        var r = a == b;
        console.log('a = ' + a + ', b = ' + b + ', a == b = ' + r);

        // !=
        var a = 1;
        var b = 2;
        var r = a != b;
        console.log('a = ' + a + ', b = ' + b + ', a != b = ' + r);
        var a = 'string';
        var b = "string";
        var r = a != b;
        console.log('a = ' + a + ', b = ' + b + ', a != b = ' + r);
        var a = 123;
        var b = '123';
        var r = a != b;
        console.log('a = ' + a + ', b = ' + b + ', a != b = ' + r);

        // ===
        var a = 1;
        var b = 2;
        var r = a === b;
        console.log('a = ' + a + ', b = ' + b + ', a === b = ' + r);
        var a = 'string';
        var b = "string";
        var r = a === b;
        console.log('a = ' + a + ', b = ' + b + ', a === b = ' + r);
        var a = 123;
        var b = '123';
        var r = a === b;
        console.log('a = ' + a + ', b = ' + b + ', a === b = ' + r);

        // !==
        var a = 1;
        var b = 2;
        var r = a !== b;
        console.log('a = ' + a + ', b = ' + b + ', a !== b = ' + r);
        var a = 'string';
        var b = "string";
        var r = a != b;
        console.log('a = ' + a + ', b = ' + b + ', a !== b = ' + r);
        var a = 123;
        var b = '123';
        var r = a !== b;
        console.log('a = ' + a + ', b = ' + b + ', a !== b = ' + r);

    </script>

</body>

</html>

<!-- 表达式和运算符 -->
<!-- https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators -->

<!-- JavaScript中的基础数学 — 数字和操作符 -->
<!-- https://developer.mozilla.org/zh-CN/docs/Learn/JavaScript/First_steps/Math -->